package com.example.demo.dao;

import com.example.demo.entity.KH;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface KHRepository extends JpaRepository<KH, Integer> {

    @Query(value = "select * from kh where kno=:kno and  kpw=:kpw", nativeQuery = true)
    KH findByKnoAndKpw(@Param("kno") String kno, @Param("kpw") String kpw);

    @Query(value = "select * from kh where kno=:kno", nativeQuery = true)
    KH findByKno(@Param("kno") String kno);

    @Query(value = "delete from kh where kid=:kid", nativeQuery = true)
    KH deleteByKid(@Param("kid") Integer kid);
}
